home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / shell / chrono.rea < prev    next >
Encoding:
Text File  |  1996-11-16  |  2.2 KB  |  65 lines

  1.  
  2. Sun Sep 10 14:08:55 EDT 1995
  3.  
  4.   Hi!
  5.  
  6.   Here's a (very) little utility I wrote one sunny Sunday afternoon to
  7.   chronometer a few tasks precisely.  Chrono, when called, pauses until the
  8.   user (that's you) presses the ENTER key (aka RETURN).
  9.   While it's chronometering, chrono can display the current time count every
  10.   second or every tenth of a second.
  11.  
  12.   For example, I use it in conjunction with dip to monitor my time usage on my
  13.   local Internet Service Provider.  The script I use to call my ISP starts
  14.   dip in a reduced window and then chrono displays the online time until I
  15.   type RETURN in that window, which kills dip and disconnects the modem.
  16.   The total online time is then appended to a log file.
  17.  
  18.   Well, it looks like this:
  19.  
  20.     #!/bin/sh
  21.     dip /root/bin/ISP.dip 2>&1
  22.     start=`date`
  23.     total=`chrono -t`
  24.     /bin/echo "$start -> `date`  Total: $total" >>/root/.ISPlog
  25.     dip -k -l modem
  26.     exit
  27.  
  28.     And the log:
  29. Sun Sep 10 03:41:29 EDT 1995 -> Sun Sep 10 03:43:30 EDT 1995  Total: 00:02:00.8
  30. Sun Sep 10 03:49:26 EDT 1995 -> Sun Sep 10 04:52:06 EDT 1995  Total: 01:02:39.6
  31. Sun Sep 10 09:35:58 EDT 1995 -> Sun Sep 10 11:19:34 EDT 1995  Total: 01:43:36.3
  32. Sun Sep 10 13:50:27 EDT 1995 -> Sun Sep 10 13:53:30 EDT 1995  Total: 00:03:02.9
  33.  
  34.   No doubt, other people will find other uses for it.
  35.  
  36.   Included in chrono.tgz are the source, a pre-compiled executable, a man
  37.   page, and this readme file.
  38.  
  39.  
  40.   To Install:
  41.  
  42.   cp chrono /usr/local/bin                      (or somewhere in your $PATH)
  43.   cp chrono.man /usr/local/man/man1/chrono.1    (or somewhere in your $MANPATH)
  44.  
  45.   To use:
  46.  
  47.   chrono -h            (Get help)
  48.   chrono               (To try out)
  49.   elapsed=`chrono -t`  (To put in a script)
  50.   elapsed=`chrono -n`  (In a script but silent)
  51.  
  52.   Copyright policy: None.  You are free to copy, modify, erase, publish,
  53.   sell, smoke, degrade, ridicule, put your name in the code and tell your
  54.   friends you wrote it for all I care, give to your auntie Louise, and
  55.   upload chrono anywhere, anyhow, anywhen.
  56.  
  57.  
  58.   Send comments, suggestions, and flames to danny@limestone.kosone.com.
  59.   Be seeing you!
  60. --
  61. danny@limestone.kosone.com
  62. Daniel Chouinard
  63. System Manager (not a programmer), CAET Project, Kingston CFB, Ont. Canada.
  64. McDonnell Douglas Training Systems
  65.